| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | Static Public Member Functions | List of all members
nkInputs::KeyboardDevice Class Referenceabstract

A keyboard device. More...

## Public Member Functions
| KeyboardDevice (System *system) noexcept
virtual | ~KeyboardDevice ()
System * | getSystem () const
virtual bool | isKeyDown (KEY_CODE keyCode)=0
virtual void | update ()=0

## Static Public Member Functions
static nkMemory::UniquePtr< KeyboardDevice > | create (System *system=nullptr)

## Detailed Description

A keyboard device.

The usual way to use the device is to create it, and update it before checking its state. Typical usage looks like :

device->update() ;
if (device->isKeyDown(...)) ...

## Constructor & Destructor Documentation

## ◆ KeyboardDevice()

nkInputs::KeyboardDevice::KeyboardDevice | ( | System * | system | ) |
| noexcept

Constructor.

Parameters

  system | The system to create the device into.

## ◆ ~KeyboardDevice()

virtual nkInputs::KeyboardDevice::~KeyboardDevice | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ getSystem()

System* nkInputs::KeyboardDevice::getSystem | ( |  | ) | const

Returns
  The system the device is in.

## ◆ isKeyDown()

virtual bool nkInputs::KeyboardDevice::isKeyDown | ( | KEY_CODE | keyCode | ) |
| pure virtual

Parameters

  keyCode | the code of the key to check.

Returns
  If the key wanted is down (true) or not (false).

## ◆ update()

virtual void nkInputs::KeyboardDevice::update | ( |  | ) |
| pure virtual

Updates the device.

## ◆ create()

static nkMemory::UniquePtr<KeyboardDevice> nkInputs::KeyboardDevice::create | ( | System * | system = `nullptr` | ) |
| static

Creates a standalone device, linking it to a system, but no manager. This method can be used to allocate a device and manually manage its lifetime.

Parameters

  system | The system to create the device into. If left to nullptr, then the Singleton instance will be used.

Returns
  The created device instance.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsInputs/Devices/Keyboards/KeyboardDevice.h